
package com.insigma.business.qrcode.common.util;

import java.util.LinkedHashMap;
import java.util.Map;


public enum SoldierStatusEnum implements TitleEnum {

    
    SUCCESS("SUCCESS"),

    
    FAIL("FAIL"),

    
    DEALING("DEALING"),

    
    NULL("NULL");

    
    private String title;

    private SoldierStatusEnum(String title) {
        this.title = title;
    }

    
    public static SoldierStatusEnum getByEnumName(final String enumName) {
        for (SoldierStatusEnum element : values()) {
            if (element.name().equals(enumName)) {
                return element;
            }
        }
        return null;
    }

    
    public static Map<String, String> getName2TitleMap() {

        final Map<String, String> name2TitleMap = new LinkedHashMap<>();

        for (SoldierStatusEnum element : values()) {
            name2TitleMap.put(element.name(), element.title);
        }

        return name2TitleMap;
    }

    @Override
    public String getTitle() {
        return this.title;
    }
}
